import React, { Component } from 'react'

export default class HookChild1 extends Component {
  constructor() {
    super();
    this.state = {
      count: 0
    }
  }
  // componentDidMount() {
  //   document.title = `点击${this.state.count}次`
  // }
  // componentDidUpdate() {
  //   document.title = `点击${this.state.count}次`
  // }
  render() {
    return (
      <div>
        <p>点击次数：{this.state.count}</p>
        <button onClick={()=>{this.setState({count: this.state.count + 1})}}>+1</button>
      </div>
    )
  }
}
